Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrTheCongNo_KhachHang
    Private tungay As String
    Private denngay As String
    Private tenkh As String
    Private customerReport As ReportDocument

    Private Sub FrmCrTheCongNo_KhachHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT t1.*,t1.ma_chungtu as sohieu FROM tbl_dot_thecongno_khachhang as t1 ORDER BY t1.ngay_chungtu, t1.ID, t1.ma_chungtu"
        Dim reportPath = Application.StartupPath & "\" & "crTheCongNo_KhachHang.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("tungay", tungay)
        customerReport.SetParameterValue("denngay", denngay)
        customerReport.SetParameterValue("TTenkh", tenkh)
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        customerReport.SetParameterValue("giamdoc", globalVariale.TONGGIAMDOC)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub

    Public Sub setTuNgay(ByVal s As String)
        tungay = s
    End Sub
    Public Sub setDenNgay(ByVal s As String)
        denngay = s
    End Sub
    Public Sub setTenkh(ByVal s As String)
        tenkh = s
    End Sub

End Class
